package com.lindroid.androiduilearning.textview.fragment;


import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lindroid.androiduilearning.R;
import com.lindroid.androiduilearning.base.BaseFragment;

/**
 * A simple {@link Fragment} subclass.
 *
 * @author linyulong
 * @function 学习了博客《Android 字体修改，所有的细节都在这里》
 * @blog 博客地址：http://mp.weixin.qq.com/s?__biz=MzIxNjc0ODExMA==&mid=2247484753&idx=1&sn=2bc7f009cc1a0bd3eeda6ae976837c43&chksm=97851c70a0f2956646cac9c7c51ccdfa00865a501c3ed93c33963da5d1fa0733231f0ba911cb&mpshare=1&scene=1&srcid=0307n3ye5KcgftDLdZpZcsAd#rd
 */
public class TextStyleFragment extends BaseFragment {


    private TextView tvSquareDeal;

    public TextStyleFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_text_style, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        tvSquareDeal = (TextView) view.findViewById(R.id.tv_square_deal);
        //使用自定义的字体
        Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fonts/square-deal.ttf");
        tvSquareDeal.setTypeface(typeface);
    }
}
